<!DOCTYPE html>
<html lang="zh-CN">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0,user-scalable=no,minimal-ui">
	<title>后花园：反馈</title>
	<link rel="stylesheet" href="/static/fonts/font-awesome-4.7.0/css/font-awesome.min.css">
	<meta name="keywords" content="出处：后花园:CPCC-版权所有，盗版必究" />
	<meta name="description" content="出处：后花园:CPCC-版权所有，盗版必究" /> 
	<meta name="author" content="出处：后花园:CPCC-版权所有，盗版必究" />
	<meta name="copyright" content="出处：后花园:CPCC-版权所有，盗版必究" />
	<link rel="stylesheet" href="/static/vendor/select2/select2.min.css">
	<link rel="stylesheet" href="/static/css/util.css">
	<link rel="stylesheet" href="/static/css/main.css">
	
</head>

<body>
<div class="dowebok container-contact100">
	<div class="wrap-contact100">
		<form class="contact100-form validate-form">
			<span class="contact100-form-title">在线反馈</span>

			<div class="wrap-input100 validate-input" data-validate="称呼不能为空">
				<label class="label-input100" for="name">称呼</label>
				<input id="name" class="input100" type="text" name="name" placeholder="请输入称呼">
				<span class="focus-input100"></span>
			</div>

			<div class="wrap-input100 validate-input" data-validate="请收入合法的邮箱地址">
				<label class="label-input100" for="email">电子邮箱</label>
				<input id="email" class="input100" type="text" name="email" placeholder="请输入电子邮箱">
				<span class="focus-input100"></span>
			</div>

			<div class="wrap-input100 validate-input" data-validate="请选择服务">
				<div class="label-input100">需要反馈的服务</div>
				<div>
					<select class="js-select2" name="service">
						<option>请选择</option>
						<?php foreach ($type as $v){ ?>
						<option value="<?php echo $v['type']; ?>"><?php echo $v['type']; ?></option>
						<?php } ?>
					</select>
					<div class="dropDownSelect2"></div>
				</div>
				<span class="focus-input100"></span>
			</div>

			<div class="wrap-input100 validate-input" data-validate="反馈不能为空">
				<label class="label-input100" for="message">反馈</label>
				<textarea id="message" class="input100" name="message" placeholder="请详细描述您的需求或反馈的内容"></textarea>
				<span class="focus-input100"></span>
			</div>

			<div class="container-contact100-form-btn">
				<button class="contact100-form-btn">提 交</button>
			</div>

		</form>

		<div class="contact100-more flex-col-c-m" style="background-image: url('/static/images/bg-01.jpg');">
		</div>
	</div>
</div>

<script src="/static/vendor/jquery/jquery-1.12.4.min.js"></script>
<script src="/static/vendor/select2/select2.min.js"></script>
<script>
	$(".js-select2").each(function(){
		$(this).select2({
			minimumResultsForSearch: 20,
			dropdownParent: $(this).next('.dropDownSelect2')
		});
	})
	$(".js-select2").each(function(){
		$(this).on('select2:open', function (e){
			$(this).parent().next().addClass('eff-focus-selection');
		});
	});
	$(".js-select2").each(function(){
		$(this).on('select2:close', function (e){
			$(this).parent().next().removeClass('eff-focus-selection');
		});
	});
	$('.contact100-form-btn').click(function (){
		var name = $('#name').val();
		var email = $('#email').val();
		var service = $('.js-select2').val();
		var message = $('#message').val();
		if(name==''){
			alert('请输入姓名');
			return false;
		}
		if(email==''){
			alert('请输入邮箱');
			return false;
		}
		if(service=='请选择'){
			alert('请选择服务类型');
			return false;
		}
		if(message==''){
			alert('请填写您的反馈');
			return false;
		}
		$.post('{:url("index/index/index")}', {
					'name': name,
					'email': email,
					'service': service,
					'remark': message
				}
				, function (res) {
					if(res.code==1){
						location.reload();
					}else{
						alert(res.msg);
						return  false;
					}
				}, 'json');
		return false;
	})
</script>
<script src="/static/js/main.js"></script>

</body>
</html>
